float4x4 World;
float4x4 View;
float4x4 Projection;

Texture texOrigin;
Texture texDestiny;
float t;

sampler textureOriginSampler = sampler_state
{
texture = <texOrigin>;
magfilter = LINEAR;
minfilter = LINEAR;
mipfilter = LINEAR;
AddressU = clamp;
AddressV = clamp;
};

sampler textureDestinySampler = sampler_state
{
texture = <texDestiny>;
magfilter = LINEAR;
minfilter = LINEAR;
mipfilter = LINEAR;
AddressU = clamp;
AddressV = clamp;
};

struct VertexShaderInput
{
    float4 Position : POSITION0;
	float2 Texture : TEXCOORD0;

};

struct VertexShaderOutput
{
    float4 Position : POSITION0;
	float2 Texture : TEXCOORD0;
    
};

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    VertexShaderOutput output;

    float4 worldPosition = mul(input.Position, World);
    float4 viewPosition = mul(worldPosition, View);

    output.Position = mul(viewPosition, Projection);

	output.Texture = input.Texture;
    return output;
}

float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
	float4 origin = tex2D(textureOriginSampler,input.Texture);
	float4 destiny = tex2D(textureDestinySampler,input.Texture);
	
	float4 output = origin * (1-t) + destiny * t;
	return output;
}

technique Technique1
{
    pass Pass1
    {

        VertexShader = compile vs_2_0 VertexShaderFunction();
        PixelShader = compile ps_2_0 PixelShaderFunction();
    }
}
